/*
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.f1x.api.message.fields;

// Generated by org.f1x.tools.DictionaryGenerator from QuickFIX dictionary
public enum InstrAttribType implements org.f1x.api.message.types.IntEnum {
	FLAT(1),
	ZERO_COUPON(2),
	INTEREST_BEARING(3),
	NO_PERIODIC_PAYMENTS(4),
	VARIABLE_RATE(5),
	LESS_FEE_FOR_PUT(6),
	STEPPED_COUPON(7),
	COUPON_PERIOD(8),
	WHEN_AND_IF_ISSUED(9),
	ORIGINAL_ISSUE_DISCOUNT(10),
	CALLABLE_PUTTABLE(11),
	ESCROWED_TO_MATURITY(12),
	ESCROWED_TO_REDEMPTION_DATE(13),
	PRE_REFUNDED(14),
	IN_DEFAULT(15),
	UNRATED(16),
	TAXABLE(17),
	INDEXED(18),
	SUBJECT_TO_ALTERNATIVE_MINIMUM_TAX(19),
	ORIGINAL_ISSUE_DISCOUNT_PRICE(20),
	CALLABLE_BELOW_MATURITY_VALUE(21),
	CALLABLE_WITHOUT_NOTICE_BY_MAIL_TO_HOLDER_UNLESS_REGISTERED(22),
	TEXT(99);

	private final int code;

	InstrAttribType (int code) {
		this.code  = code;
	}

	public int getCode() { return code; }

	public static InstrAttribType parse(String s) {
		switch(s) {
			case "1" : return FLAT;
			case "2" : return ZERO_COUPON;
			case "3" : return INTEREST_BEARING;
			case "4" : return NO_PERIODIC_PAYMENTS;
			case "5" : return VARIABLE_RATE;
			case "6" : return LESS_FEE_FOR_PUT;
			case "7" : return STEPPED_COUPON;
			case "8" : return COUPON_PERIOD;
			case "9" : return WHEN_AND_IF_ISSUED;
			case "10" : return ORIGINAL_ISSUE_DISCOUNT;
			case "11" : return CALLABLE_PUTTABLE;
			case "12" : return ESCROWED_TO_MATURITY;
			case "13" : return ESCROWED_TO_REDEMPTION_DATE;
			case "14" : return PRE_REFUNDED;
			case "15" : return IN_DEFAULT;
			case "16" : return UNRATED;
			case "17" : return TAXABLE;
			case "18" : return INDEXED;
			case "19" : return SUBJECT_TO_ALTERNATIVE_MINIMUM_TAX;
			case "20" : return ORIGINAL_ISSUE_DISCOUNT_PRICE;
			case "21" : return CALLABLE_BELOW_MATURITY_VALUE;
			case "22" : return CALLABLE_WITHOUT_NOTICE_BY_MAIL_TO_HOLDER_UNLESS_REGISTERED;
			case "99" : return TEXT;
		}
		return null;
	}

}